package com.tang.param_check.common.login;

import com.tang.param_check.domain.LoginDTO;
import com.tang.param_check.domain.LoginTypeEnum;
import org.springframework.stereotype.Component;

import java.util.Objects;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2022/1/15 20:44
 * @Desc
 * @Remarks
 */
@Component
public class WechatLoginHandler extends AbstractLoginHandler {
    @Override
    protected String execute(LoginDTO parameter) {
        System.out.println("WechatLoginHandler处理成功");

        return "success";
    }

    @Override
    public boolean canHandler(LoginDTO parameter) {
        return Objects.equals(LoginTypeEnum.findByCode(parameter.getType()), LoginTypeEnum.WECHAT_NUMBER);
    }
}
